Skip to content

fix(analytics): retain Countme zeros and preserve missing values as gaps - #1110

Open
castrojo wants to merge 1 commit into
projectbluefin:v4from
castrojo:fix-countme-zeros-gaps
Open

fix(analytics): retain Countme zeros and preserve missing values as gaps#1110
castrojo wants to merge 1 commit into
projectbluefin:v4from
castrojo:fix-countme-zeros-gaps

Conversation

@castrojo

@castrojo castrojo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #1086

Problem

Project Bluefin family cards on the analytics page computed isTracked = count > 0. A real reported zero (e.g. Dakota's weekly value of 0) was indistinguishable from a missing week, so:

  • the sparkline history was cleared to [] entirely instead of rendering with a gap for the missing point, and
  • the card fell back to its bootstrapping/provisioning placeholder text instead of showing the actual trend.

Fix

Added a shared readCount() helper that returns the reported value (including 0) and only returns null when a field is genuinely absent or non-finite — matching the gapSafe() convention already used by the comparative time-series charts in this file. isTracked, the per-card count, and the 12-week sparkline history now all key off count !== null rather than count > 0, so:

  • a real 0 renders as 0 (not a placeholder), and
  • only genuinely missing weeks render as sparkline gaps.

Testing

  • npx tsc --noEmit — no new errors
  • npx eslint src/components/analytics/CountmeAnalyticsCharts.tsx — clean
  • npx prettier --check — clean

— hive: backend=copilot model=claude-sonnet-5

🐝 Hive Agent: contributor | SHA: ed9a243e

Project Bluefin family cards computed isTracked as count > 0, so a real
reported zero (e.g. Dakota weekly value 0) was treated identically to
missing data: the sparkline history was cleared to [] and the card fell
back to its bootstrapping/provisioning placeholder text instead of
showing the trend.

Read counts through a shared readCount() helper that keeps a reported
0 as 0 and only returns null when the field is actually absent or
non-finite, matching the gapSafe() convention already used by the
comparative charts in this file. isTracked and per-week history now key
off count !== null instead of count > 0, so zero values stay visible
and only genuinely missing weeks render as sparkline gaps.

Signed-off-by: castrojo <castrojo@users.noreply.github.com>
@castrojo castrojo added the 3-clanker-queue Work admitted to the agent-maintained queue. label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3-clanker-queue Work admitted to the agent-maintained queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant